package correct.day17;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        StringBuffer stringBuffer = new StringBuffer();
        while(n != 0) {
            if(n % 2 == 0) {
                stringBuffer.append("0");
            }else {
                stringBuffer.append("1");
            }
            n /= 10;
        }
        String s = stringBuffer.toString();
        int len = s.length();
        int a = 0;
        for(int i = 0; i < len; i++) {
            a += (s.charAt(i) - '0') * Math.pow(10, i);
        }
        System.out.println(a);
    }
}
